
import React from 'react';
import ReactDOM from 'react-dom';

import { Router, browserHistory } from 'react-router';

import routes from './pages';

function render() {
  const dest = document.getElementById('content');

  if (__DEV__) {
    window.React = React; // enable debugger
  }

  ReactDOM.render(
    <Router routes={routes} history={browserHistory}/>,
    dest
  );
}

if (document.readyState !== 'loading') {
  render();
} else {
  document.addEventListener('DOMContentLoaded', render);
}
